package com.qfedu.schedule;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.Date;

@Component
public class MyScheduled {

    @Scheduled(cron = "0-10 * * * * ?")   //定时器注解，按照cron表达式里面指定的周期取执行
    //每隔两秒去执行
    public void  scheduled(){
        //业务代码
        System.out.println("excute...."+new Date());
    }
}